<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
include ("connectDB.php");

$action=$_POST["selectAction"];
if($action="search"){
	$sql="select * from test order by id";
	$rs=query($sql);
}
?>
<script type="text/javascript">
    function openwin(x){
    	var str="/example.php";
    	window.open(str,"newwindow","height=200, top=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
    }
    function jumpToAdd(){
    	location.href('addInfo.php')
    }
</script>
<table>
	<tr>
		<td>
			<form id="form1" name="form1" method="post" action="">
				<input name="selectAction" type="hidden" value="search" /> <input type="submit" name="selectall" value="查询" />
			</form>
		</td>
		<td>
			<form>
				<input type="button" value="新增" onclick="jumpToAdd()" />
			</form>
		</td>
	</tr>
</table>

<table border='2'>
	<tr>
		<td>ID</td>
		<td>编号</td>
		<td>姓名</td>
		<td>操作</td>
		<td>操作</td>
	</tr>
	<?php if(mysql_num_rows($rs)!=0){while($row_Recordset = mysql_fetch_array($rs)){ ?>
	<tr>
		<td><?php echo $row_Recordset['id']; ?></td>
		<td><?php echo $row_Recordset['code']; ?></td>
		<td><?php echo $row_Recordset['name']; ?></td>
		<td><a href="/updateInfo.php?id=<?php echo $row_Recordset["id"]; ?>">修改</a></td>
		<td><a href="/delete.php?id=<?php echo $row_Recordset["id"]; ?>">删除</a></td>
	</tr>
	<?php }} ?>
</table>

<br />
